mixin accountLinks
  li
    a(href="/user/#{me.getSlugOrID()}", data-i18n="nav.profile")
  li
    a(href="/account/settings", data-i18n="play.settings")
  if me.isAdmin() || !(me.isTeacher() || me.isStudent())
    li
      a(href="/account/payments", data-i18n="account.payments")
  if me.isAdmin() || !(me.isTeacher() || me.isStudent()) || me.hasSubscription()
    li
      a(href="/account/subscription", data-i18n="account.subscription")
  if me.isAdmin() || !(me.isTeacher() || me.isStudent())
    li
      a(href="/account/prepaid", data-i18n="account.prepaid_codes")
  li
    a#logout-button(data-i18n="login.log_out")

.style-flat
  block header
    nav#main-nav.navbar.navbar-default
      .container-fluid.container
        .row
          .col-md-12
            .navbar-header
              button.navbar-toggle.collapsed(data-toggle='collapse', data-target='#navbar-collapse' aria-expanded='false')
                span.sr-only(data-i18n="nav.toggle_nav")
                span.icon-bar
                span.icon-bar
                span.icon-bar
              a.navbar-brand(href="/")
                if serverConfig.codeNinjas
                  img#logo-img.code-ninjas-powered-by(src="/images/pages/base/logo.png")
                  img.code-ninjas-logo(src="/images/pages/base/code-ninjas-logo-right.png")
                else
                  img#logo-img(src="/images/pages/base/logo.png")
                span.glyphicon.glyphicon-home

            #navbar-collapse.collapse.navbar-collapse
              ul.nav.navbar-nav
                li
                  a(href="/about", data-i18n="nav.about")
                if me.isStudent()
                  li
                    a(href="/students", data-i18n="nav.my_courses")
                if !me.isAnonymous() && me.isTeacher()
                  li
                    a(href="/teachers/classes", data-i18n="nav.my_classrooms")
                if !me.isAnonymous() && !me.isStudent() && !me.isTeacher()
                  li
                    a(href="/play", data-i18n="common.play")
                  li
                    a(href=view.forumLink(), data-i18n="nav.forum")
              if me.isAnonymous()
                ul.nav.navbar-nav
                  li
                    a#create-account-link.signup-button(data-i18n="login.sign_up")
                  li
                    a#login-link.login-button(data-i18n="login.log_in")
              else
                ul.nav.navbar-nav.hidden-md.hidden-lg
                  li.disabled
                    a
                      img.img-circle.img-circle-small.m-r-1(src=me.getPhotoURL() class=(me.isTeacher() ? 'border-navy' : ''))
                      span= me.displayName()
                  +accountLinks

                ul.nav.navbar-nav
                  li.dropdown.hidden-xs.hidden-sm
                    a.dropdown-toggle(href="#", data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false")
                      img.img-circle.img-circle-small.m-r-1(src=me.getPhotoURL() class=(me.isTeacher() ? 'border-navy' : ''))
                      span(data-i18n="nav.my_account")
                    ul.dropdown-menu
                      li.user-dropdown-header.text-center
                        span.user-level= me.level()
                        a(href="/user/#{me.getSlugOrID()}")
                          img.img-circle(src=me.getPhotoURL() class=(me.isTeacher() ? 'border-navy' : ''))
                        h5=me.broadName()
                      +accountLinks

              ul.nav.navbar-nav
                li
                  #language-dropdown-wrapper
                    select.language-dropdown.form-control

  block page_nav

  block outer_content
    #site-content-area
      block content
        p If this is showing, you dun goofed

  block footer
    .container-fluid
      #footer.small
        .container
          .row
            .col-sm-3
              ul.list-unstyled
                li
                  strong CodeCombat
                li
                  a(href="/about", data-i18n="nav.about")
                li
                  a(href="/about#jobs", data-i18n="nav.jobs")
                li
                  a(href="http://blog.codecombat.com/", data-i18n="nav.blog")
                li
                  a(href="/legal", data-i18n="nav.legal")
                li
                  a(href="/privacy", data-i18n="nav.privacy")

            if !me.isStudent()
              .col-sm-3
                ul.list-unstyled
                  li
                    strong(data-i18n="nav.schools")
                  li
                    a(href="/teachers/resources/faq", data-i18n="teacher.educator_faq")
                  li
                    a(href="/teachers/classes", data-i18n="nav.my_classrooms")
                  li
                    a(href="/teachers/resources", data-i18n="nav.resource_hub")
                  li
                    a(href="/teachers/demo", data-i18n="new_home.request_demo")

            .col-sm-3
              ul.list-unstyled
                li
                  strong(data-i18n="nav.get_involved")
                li
                  a(href='/community', data-i18n="nav.community")
                li
                  a(href="/contribute", data-i18n="nav.contribute")
                if !me.isStudent()
                  li
                    a(href=view.forumLink(), data-i18n="nav.forum")
                li
                  a(href="/play/ladder", data-i18n="game_menu.multiplayer_tab")
                li
                  a(href="https://github.com/codecombat/codecombat", data-i18n="nav.open_source")
            .col-sm-3
              ul.list-unstyled
                li
                  strong(data-i18n="nav.support")
                if !me.isStudent()
                  li
                    a.contact-modal(tabindex=-1, data-i18n="nav.contact")
                li
                  a(href="https://www.facebook.com/codecombat", data-i18n="nav.facebook")
                li
                  a(href="https://twitter.com/codecombat", data-i18n="nav.twitter")

      #final-footer.small.text-center
        | Copyright ©2016 CodeCombat. All Rights Reserved.
        br.hidden-lg.hidden-md
        img(src="/images/pages/base/logo.png" alt="CodeCombat")
        br.hidden-lg.hidden-md
        if !me.isStudent()
          span.spr(data-i18n="nav.help_pref")
          - var supportEmail = (me.get('preferredLanguage', true) || 'en-US').split('-')[0] == 'nl' ? 'klantenservice@codecombat.nl' : 'team@codecombat.com';
          a(href="mailto:" + supportEmail)= supportEmail
          span.spl(data-i18n="nav.help_suff")
